/**
 * 
 */
package com.glodon.paas.document.biz;

import java.util.List;

import com.glodon.paas.document.api.bean.ProjectMemberAttendees;
import com.glodon.paas.document.dao.domain.FileInfoEntity;
import com.glodon.paas.document.dao.domain.InvitationEntity;
import com.glodon.paas.document.dao.domain.ProjectInfoEntity;
import com.glodon.paas.document.dao.domain.ProjectMemberAttendeesEntity;
import com.glodon.paas.document.dao.domain.ProjectMemberEntity;
import com.glodon.paas.document.dao.domain.ProjectResourceEntity;
import com.glodon.paas.document.dao.domain.ProjectRoleEntity;

/**
 * @author xur
 */
public interface ProjectBiz {

    String createProject(ProjectInfoEntity project, FileInfoEntity folder, ProjectRoleEntity role, ProjectRoleEntity defaultRole,
                         ProjectMemberEntity member,ProjectMemberAttendeesEntity attendee, ProjectResourceEntity ownerRoleResource, ProjectResourceEntity defaultRoleResource);

    boolean deleteProject(String id);

    boolean updateProject(ProjectInfoEntity entity);

    List<ProjectInfoEntity> listProjects(String ownerId);

    List<ProjectInfoEntity> getProjectByIds(List<String> ids);

    ProjectInfoEntity getProjectById(String projectId);

    String createRole(ProjectRoleEntity role, ProjectResourceEntity resource);

    List<ProjectRoleEntity> listRoles(String projectId);

    ProjectRoleEntity getDefaultRole(String projectId);
    
    ProjectRoleEntity getRole(String roleId);

    ProjectRoleEntity updateRole(String userId, String roleId, String name);

    boolean deleteRole(String roleId);

    boolean checkSameRole(ProjectRoleEntity role);

    ProjectInfoEntity getProjectByName(String ownerId, String Name);

    String insertMember(ProjectMemberEntity entity);

    List<ProjectMemberEntity> getMembers(String projectId, String roleId);
    ProjectMemberEntity getMember(String projectId, String roleId,String account,String groupId);
    ProjectMemberEntity getMember(String memberId);

    ProjectMemberEntity getConfirmedMember(String userId, String token);

    int setDefaultRoleForMember(String projectId, String roleId);

    boolean removeMember(String memberId,boolean deleteMember);

    boolean updateMemberStatus(String memberId, int status);

    boolean insertInvitation(InvitationEntity entity);

    boolean confirmInvitation(String userId, String token);
    
    boolean updateInvitationStatus(String userId, String token);
    
    boolean updateRoleOfMember(String memberId, String projectId, String oldRoleId, String newRoleId);
    
    List<ProjectMemberEntity> getAddedOrgs(String projectId,String roleId);
    
    String insertAttendees(ProjectMemberAttendeesEntity entity);
    
    List<ProjectMemberAttendees>getAttendees(String projectMemberId);
    
    ProjectMemberAttendeesEntity getAttendeeById(String id);
    ProjectMemberAttendeesEntity getAttendeeByUIDandPMID(String userId,String projectMemberId);
    boolean setInvitaionInvalid(String id);
    void updateAttendeeInvitation(String attendeeId,String invitationId);
}
